// 高德地图配置
export const AMAP_CONFIG = {
  // 你的高德地图API Key
  apiKey: "6a63761a2734a27ce7022c80142d28d0",
  
  // 默认配置
  version: "2.0",
  plugins: [
    "AMap.Autocomplete",
    "AMap.PlaceSearch", 
    "AMap.Geocoder"
  ],
  
  // 默认地图配置
  defaultCenter: [116.397428, 39.90923], // 北京天安门
  defaultZoom: 13,
  defaultCity: "全国"
};

// 检查API Key是否有效
export function validateApiKey(key) {
  if (!key || key === "你的高德地图API_KEY" || key === "YOUR_AMAP_API_KEY") {
    return false;
  }
  return true;
}

// 获取完整的API URL
export function getAmapApiUrl(key = AMAP_CONFIG.apiKey) {
  const plugins = AMAP_CONFIG.plugins.join(',');
  return `https://webapi.amap.com/maps?v=${AMAP_CONFIG.version}&key=${key}&plugin=${plugins}`;
}